<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Title</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/weadmin/css/we.css">
</head>
<body class="unibody">
<div class="layui-fluid">
<div class="layui-row">
    <div class="layui-col-md12">
        <blockquote class="layui-elem-quote layui-quote-nm">
            <div class="layui-row">
                <div class="layui-col-md1">
                    <a class="layui-btn layui-btn-normal user-add"><i class="layui-icon">&#xe608;</i>添加</a>
                </div>
            </div>
        </blockquote>
    </div>
    <hr class="layui-bg-blue">
    <div class="layui-col-md12">
        <table class="layui-table">
            <colgroup>
                <col width="30">
                <col><col><col><col><col>
                <col width="180">
            </colgroup>
            <thead>
                <tr>
                    <th>ID</th>
                    <th>用户名</th>
                    <th>邮箱</th>
                    <th>电话</th>
                    <th>用户性别</th>
                    <th>出生日期</th>
                    <th>创建时间</th>
                    <th>更新时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {{foreach name="list" item="vo"}}
                    <tr>
                        <td>{{$vo.id}}</td>
                        <td>{{$vo.name}}</td>
                        <td>{{$vo.email}}</td>
                        <td>{{$vo.phone}}</td>
                        <td>{{$vo.sex}}</td>
                        <td>{{$vo.birth_at}}</td>
                        <td>{{$vo.created_at}}</td>
                        <td>{{$vo.updated_at}}</td>
                        <td align="center">
                            <a class="layui-btn layui-btn-xs edit" id="{{$vo.id}}">编辑</a>
                            <a class="layui-btn layui-btn-danger layui-btn-xs del" id="{{$vo.id}}">删除</a>
                        </td>
                    </tr>
                {{/foreach}}
            </tbody>
        </table>
    </div>
</div>
</div>
<script src="/static/layui/layui.js"></script>
<script src="/static/weadmin/js/admin/user/user.js"></script>
</body>
<!-- 添加页 -->
<div class="lay-row user-from" hidden>
    <hr>
    <div class="layui-col-md11">
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">用户名</label>
                <div class="layui-input-block">
                    <input type="text" name="name" required lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">邮箱</label>
                <div class="layui-input-block">
                    <input type="text" name="email" lay-verify="email" placeholder="请输入邮箱" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">电话</label>
                <div class="layui-input-block">
                    <input type="text" name="phone" lay-verify="phone" placeholder="请输入电话" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">密码</label>
                <div class="layui-input-block">
                    <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">确认密码</label>
                <div class="layui-input-block">
                    <input type="password" name="passwords" required lay-verify="pass" placeholder="请确认密码" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">分配角色</label>
                <div class="layui-input-block">
                    {{foreach name="role" item="vo"}}
                        <input type="checkbox" name="role[]" value="{{$vo.id}}" title="{{$vo.name}}">
                    {{/foreach}}
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">出生日期</label>
                <div class="layui-input-block">
                    <input type="text" name="birth_at" id="birthday" placeholder="请选择日期" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formUser">立即提交</button>
                    <!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
                </div>
            </div>
        </form>
    </div>
    <hr>
</div>
<!-- 修改页 -->
<div class="lay-row user-edit" hidden>
    <hr>
    <div class="layui-col-md11">
        <form class="layui-form" action="">
            <input type="hidden" name="id" id="id-edit" value="">
            <div class="layui-form-item">
                <label class="layui-form-label">用户名</label>
                <div class="layui-input-block">
                    <input type="text" name="name" id="name-edit" required lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">邮箱</label>
                <div class="layui-input-block">
                    <input type="text" name="email" id="email-edit" lay-verify="email" placeholder="请输入邮箱" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">电话</label>
                <div class="layui-input-block">
                    <input type="text" name="phone" id="phone-edit" lay-verify="phone" placeholder="请输入电话" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">密码</label>
                <div class="layui-input-block">
                    <input type="password" name="password" id="password-edit" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">确认密码</label>
                <div class="layui-input-block">
                    <input type="password" name="passwords" id="passwords-edit" required lay-verify="pa" placeholder="请确认密码" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">分配角色</label>
                <div class="layui-input-block role-edit-input">
                    {{foreach name="role" item="val" key="i"}}
                        <input type="checkbox" name="role[]" value="{{$val.id}}" title="{{$val.name}}">
                    {{/foreach}}
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">出生日期</label>
                <div class="layui-input-block">
                    <input type="text" name="birth_at" id="birthday-edit" placeholder="请选择日期" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formUserEdit">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
    <hr>
</div>
</html>